class LinkNoteMenu {
    constructor() {
        this.title = '关联笔记'
        this.tag = 'button'
        this.iconSvg = '<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg"><path d="M832 704V576h64V128H384v448h192v128H256V0h768v704h-192zM128 896h512V448H448V320h320v704H0V320h192v128H128v448z"></path></svg>'
    }
    getValue(editor) {
        return 'linkNote'
    }
    isActive(editor) {
        return false
    }
    isDisabled(editor) {
        if (editor.selection) {
            const {anchor, focus} = editor.selection
            return !(anchor.offset === focus.offset &&
              anchor.path[0] === focus.path[0] &&
              anchor.path[1] === focus.path[1]
            )
        }
        return true
    }
    exec(editor, value) {
        if (this.isDisabled(editor))
            return ''
        editor.emit('linkNote', value)
    }
}

export default LinkNoteMenu